#include <iostream>
#include <stack>

using namespace std;

stack<char> s;

void clear_stack(){
    while(!s.empty())
        s.pop();
}

int main(){
    int n,i;
    char temp;
    int counter = 0;
    int len = 0;
    int maxlen = 0;
    while(cin >> n){
       counter =0;
       len = 0;
       maxlen = 0;
        for(i = 0; i <= n; i++){
            cin>>temp;
            if(temp == '(')
                s.push(temp);
            else{
                if(s.empty()){
                    if(len > maxlen){
                        maxlen = len;
                        counter = 1;
                    }
                    else if(len == maxlen && len !=0){
                        counter ++;
                        len =0;
                    }
                }
                else{
                    s.pop();
                    len += 2;
                }
            }
        }
    
    cout<<maxlen<<' '<<counter<<endl;
    }
}
